package com.huike.service;

import com.huike.mapper.RegisterMapper;
import com.huike.pojo.Register;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RegisterService {
    @Autowired
    private RegisterMapper registerMapper;
    public List<Register> findAll(){return registerMapper.findAll();}

    public List<Register> PaginationSearch(Integer id, String registerName, String deptName, String star, String end) {
        return registerMapper.PaginationSearch(id,registerName,deptName,star,end);
    }

    public Register findById(Integer id) { return registerMapper.findById(id);
    }

    public void update(Integer id, String registerName, String idNumber,
                       String medicalNumber, String phone, Integer selfPrice,
                       Integer sex, Integer age, Integer lookDoctor,
                       Integer department, Integer doctorId, String note) {
        registerMapper.update(id,registerName,idNumber,medicalNumber,phone,
                selfPrice,sex,age,lookDoctor,department,
                doctorId ,note);
    }

    public List<Register> PaginationSearchForISC(Integer id, String registerName) {
        return registerMapper.PaginationSearchForISC(id,registerName);
    }

    public void updateForAdd(Integer id, String registerName, String idNumber,
                             String medicalNumber, String phone, Integer selfPrice,
                             Integer sex, Integer age, Integer lookDoctor,
                             Integer doctorId, String note) {
         registerMapper.updateForAdd(id,registerName,idNumber,medicalNumber,phone,
                selfPrice,sex,age,lookDoctor,
                doctorId ,note);
    }

    public void updateStatus(Integer id) {
        registerMapper.updateStatus(id);
    }

    public List<Register> getRegisters(Integer id, String registerName, String deptName,
                                       String star, String end){
        return registerMapper.getRegisters(id,registerName,deptName,star,end);
    }

    //挂号
    public Integer addRegister(Register register){
        return registerMapper.addRegister(register);
    }

    //更新状态
    public Integer rUpdateStatus(Integer id,Integer status){
        return  registerMapper.rUpdateStatus(id,status);
    }

    public Integer updateRegister(Register register){
        return registerMapper.updateRegister(register);
    }

    public List<Register> getAllRegister(){
        return registerMapper.getAllRegister();
    }

}
